﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;

using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;


public partial class Index : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            load_Menu();
            load_ADVERTISE();
            load_MenuLeft();
            load_CategoryNews();
            load_TinNoiBat();
            load_DoiTac();
            load_TOP3_NEWS();
        }
    }

    public void load_Menu()
    {
        rpMenu.DataSource = BusLogic.Menu.get_ALL_MENUPARENT();
        rpMenu.DataBind();
    }

    public void load_ADVERTISE()
    {
        rpAdvertiseTrungTam.DataSource = BusLogic.Advertise.get_AdvertisePosition(1);
        rpAdvertiseTrungTam.DataBind();

        //rpAdvertiseTinTuc.DataSource = BusLogic.Advertise.get_AdvertisePosition(2);
        //rpAdvertiseTinTuc.DataBind();

        //rpAdvertiseDaoTao.DataSource = BusLogic.Advertise.get_AdvertisePosition(3);
        //rpAdvertiseDaoTao.DataBind();

        //rpAdvertiseHinhAnh.DataSource = BusLogic.Advertise.get_AdvertisePosition(4);
        //rpAdvertiseHinhAnh.DataBind();
    }

    public void load_MenuLeft()
    {
        rpDienLanh.DataSource = BusLogic.News.get_ALL_NEWS_BY_CATEGORY(22);
        rpDienLanh.DataBind();

        rpDienTu.DataSource = BusLogic.News.get_ALL_NEWS_BY_CATEGORY(23);
        rpDienTu.DataBind();
    }

    public void load_CategoryNews()
    {
        rpSuaChuaDienLanh.DataSource = BusLogic.News.get_ALL_NEWS_BY_CATEGORY(22);
        rpSuaChuaDienLanh.DataBind();

        rpDichVu.DataSource = BusLogic.News.get_ALL_NEWS_BY_CATEGORY(15);
        rpDichVu.DataBind();
    }

    public void load_TinNoiBat()
    {
        rpTinNoiBat.DataSource = BusLogic.News.get_ALL_NEWS_BY_CATEGORY(16);
        rpTinNoiBat.DataBind();
    }

    public void load_DoiTac()
    {
        rpDoiTac.DataSource = BusLogic.Advertise.get_AdvertisePosition(2);
        rpDoiTac.DataBind();
    }

    public void load_TOP3_NEWS()
    {
        rpTop3News.DataSource = BusLogic.News.get_TOP_3_NEWS_TINTUC();
        rpTop3News.DataBind();
    }
}
